﻿@{ ViewBag.Title = "产品展示";

    Layout = "~/Views/Shared/_HTMLLayout.cshtml"; }

<link rel="stylesheet" type="text/css" href='@Url.Content("~/css/sub.css")' />

<script>
    $(document).ready(function () {
        $(window).load(function () {
            $("nav a:nth-child(4)").addClass("onFocus")
        })
    })</script>

<dl class="productPic"></dl>

<dl class="productList">
    <dt><img src='@Url.Content("~/img/sub/product_title.png")'></dt>
    <dd id="prodlist"></dd>
    <div class="bgProduct"></div>
</dl>

@Html.Partial("KnowledgePart")

<script type="text/javascript">
    $(function () {
        initProduct();
    });

    function initProduct() {
        var queryUrl = querybase + '/News/GetPageList?NewsType=2&Sort=BaseModifyTime';

        $.ajax({
            type: "GET",
            url: queryUrl,
            data: {},
            datatype: "json",
            success: function (data) {
                var items = data.Data;
                var htm = "";
                if (items != null && items != undefined) {
                    for (var i = 0; i < items.length; i++) {

                        htm += '<a href=\"\/home\/detail\/' + items[i].Id + '\"><img src=\"' + items[i].ThumbImage + '\"></a>';
                    }

                    if (items.length % 4 > 0) {
                        for (var a = 0; a < (4 - items.length % 4); a++) {
                            htm += '<a></a>';
                        }
                    }

                    $("#prodlist").html(htm);
                }
            }
        });
    }
</script>
 